// @ts-nocheck
const express = require('express');
const pool = require('../pool.js');

const router = express.Router();

// 首页地点分类显示
//页面地址：http://127.0.0.1:8080/
router.get('/', (req, res, next) => {
  //查询的sql
  pool.query('select * from indexinf', (err, data) => {
    if (err) {
      next(err);
      return;
    }
    if (data.length) {
      res.send({
        "code": 1,
        "msg": "加载成功",
        "data": data
      })
    } else {
      res.send({
        "code": 0,
        "msg": "加载失败"
      })
    }
  })
})


//导出路由器对象
module.exports = router;